Include Script %_WISE_%\INCLUDE\vb6check.wse

Stop writing to installation log

 

Rem If the destination system does not have a writable Windows\System directory, system files will be written to the Windows\ directory

If Directory not writable %SYS% then

   Set Variable SYS to %WIN%

End

 

Rem APPTITLE is the application title of the installation

Set Variable APPTITLE to Professional VB 6 - Hello World

 

Rem GROUP is the variable that holds the Program Files Group that shortcuts will be placed on the Windows Start Menu

Set Variable GROUP to Hello World Group

 

Rem DISABLED variable is initialized for backward compatability

Set Variable DISABLED to !

 

Rem MAINDIR is the variable that holds the default destination directory

Set Variable MAINDIR to HelloWorld

 

Rem USERNAME is the variable that holds the Windows Logon name

Get System Information into USERNAME

 

Rem This IF/THEN/ELSE blocks reads the default Program Files and Common directories from the registry

If System Has Windows 95 Shell Interface then

   Get Registry Key SOFTWARE\Microsoft\Windows\CurrentVersion place in Variable COMMON

   Get Registry Key SOFTWARE\Microsoft\Windows\CurrentVersion place in Variable PROGRAM_FILES

   Set Variable MAINDIR to %PROGRAM_FILES%\%MAINDIR%

   Set Variable EXPLORER to 1

Else

   Set Variable MAINDIR to C:\%MAINDIR%

End

 

Rem BACKUP is the variable that holds the path that all backup files will be copied to when overwritten

Set Variable BACKUP to %MAINDIR%\BACKUP

 

Rem DOBACKUP determines if a backup will be performed.  The possible values are A (do backup) or B (do not do backup)

Set Variable DOBACKUP to B

 

Rem If COMPONENTS are enabled, the COMPONENTS variable is initialized with possible selections

Set Variable COMPONENTS to A

 

Rem BRANDING determines if the installation will be branded with a name and company.  By default, this is written to the INST directory (installation media).

Set Variable BRANDING to 0

If BRANDING Equals "1" then

   Read INI Value from %INST%\CUSTDATA.INI into Variable NAME

   Read INI Value from %INST%\CUSTDATA.INI into Variable COMPANY

   If NAME Equals "" then

      Set Variable DOBRAND to 1

      Get System Information into NAME

      Get System Information into COMPANY

   End

End

 

Rem The Wizard Loop contains the dialog screens that the user sees in the installation

Rem If you would like to change the graphic on the dialog boxes, you need to change it by double-clicking on the Wizard Loop line and change the bitmap path.

Wizard Loop

   Rem If you need to change the size of your Custom Dialogs, you need only change the "Welcome" screen.  

   Rem It's size is the template for all following dialogs within the Wizard Loop.

   Custom Dialog "Welcome"

   Custom Dialog "Select Destination Directory"

   Custom Dialog "Select Components"

   Custom Dialog "Start Installation"

   Rem This reinitialized the BACKUP directory so that it reflects the change the user made to MAINDIR

   If DISPLAY Equals "Select Destination Directory" then

      Set Variable BACKUP to %MAINDIR%\BACKUP

   End

End

 

Rem When the BACKUP feature is enabled, the BACKUPDIR is initialized

If DOBACKUP Equals "A" then

   Set Variable BACKUPDIR to %BACKUP%

End

 

Rem The BRANDING information is written to the INI file on the installation media.

If BRANDING Equals "1" then

   If DOBRAND Equals "1" then

      Edit INI File %INST%\CUSTDATA.INI

   End

End

 

Rem Begin writing to the INSTALL.LOG 

Continue/Start writing to installation log

 

Rem Check free disk space calculates free disk space as well as component sizes.

Rem It should be located before all Install File actions.

Check free disk space

Include Script %_WISE_%\INCLUDE\vb6.wse

 

Rem This include script allows uninstall support

Include Script %_WISE_%\INCLUDE\uninstal.wse

Install File c:\HelloWorld\HelloWorld.exe to %MAINDIR%\HelloWorld.exe (Version)

If COMPONENTS Contains Any Letters In "A" then

   Install File c:\HelloWorld\Sample.rpt to %MAINDIR%\Sample.rpt

End

 

Rem The following two lines reset COMMON and MAINDIR to short filesnames. This is for backwards compatibility.

Set Variable COMMON to %COMMON%

Set Variable MAINDIR to %MAINDIR%

 

Rem This IF/THEN/ELSE reads the correct registry entries for shortcut/icon placement

If System Has Windows 95 Shell Interface then

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable STARTUPDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable DESKTOPDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable STARTMENUDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable GROUPDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable CSTARTUPDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable CDESKTOPDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable CSTARTMENUDIR

   Get Registry Key Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders place in Variable CGROUPDIR

   Set Variable CGROUP_SAVE to %GROUP%

   Set Variable GROUP to %GROUPDIR%\%GROUP%

   Create Shortcut from %MAINDIR%\HelloWorld.exe to %CGROUPDIR%\%CGROUP_SAVE%\Hello World Program.lnk

Else

   Add Icon "Hello World Program" to Program Manager Group "%GROUP%"

End

 

Rem All OCX/DLL/EXE files that are self-registered

Self-Register OCXs/DLLs/EXEs

 

Rem This Wizard Loop finalizes the install 

Wizard Loop

   Custom Dialog "Finished"

End

Edit 7 registry keys



